home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.20010306-20010921
/
000264_fdc@watsun.cc.columbia.edu_Thu Jul 12 16:18:51 EDT 2001.msg
< prev
next >
Wrap
Text File
|
2020-01-01
|
3KB
|
83 lines
Article: 12595 of comp.protocols.kermit.misc
Path: newsmaster.cc.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: ssh script example
Date: 12 Jul 2001 20:19:08 GMT
Organization: Columbia University
Lines: 66
Message-ID: <9il0ns$3h8$1@newsmaster.cc.columbia.edu>
References: <a695e0e6.0107121149.6d5ab7bb@posting.google.com>
NNTP-Posting-Host: watsun.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 994969148 3624 128.59.39.2 (12 Jul 2001 20:19:08 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 12 Jul 2001 20:19:08 GMT
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:12595
In article <a695e0e6.0107121149.6d5ab7bb@posting.google.com>,
Andy Pyles <a_pyles@yahoo.com> wrote:
: I'm using c-kermit 7.0 on a redhat 6.2 linux machine.
: and trying to script a simple ssh login script.
:
: ~~~~~~~~~~~~~~~~~~~~~~~
: #!/usr/bin/kermit +
: ; expect script that will automatically upgrade telverse ui files on
: ; remote system. using the ssh protocol.
: ; usage uiupgrade username hostname password
:
: ;set prefixing all
: set transaction-log verbose
: log session session.log
: set host /pty ssh -l \%1 \%2
: if fail out failed!!
:
: input 10 password:
: if fail out no password prompt!
: out \%3\13
: input 10 ]$
: out touch /tmp/blaHH\13
: input 10 ]$
: out exit\13
: lineout ~.
: logout
: exit
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: Ok, so the problem I have is when I run this script I just get the following:
:
: [andy@dev1 images]$ ./ssh_kermit.ker andy dev1 password
: no password prompt!password
: touch /tmp/blaHH
: [andy@dev1 images]$
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:
: any clue on what I'm doing wrong here?
:
I don't see anything obviously wrong with the script, but...
1. This should work better in C-Kermit 8.0:
http://www.columbia.edu/kermit/ck80.html
The pty interface didn't work right with scripting on every
platform; please try 8.0 and see that improves matters.
2. Maybe there really was no password: prompt. You can use
"set input echo on" to watch what happens.
3. "if fail out no password prompt!" just sends "no password prompt!"
to the pty. Maybe you meant:
if fail exit 1 No password prompt.
4. The the rest of the INPUT statements all should have "if fail" clauses
after them.
5. If you use:
set host /pty -e none ...
then you shouldn't need the "lineout ~." and "logout".
- Frank